package per.sen.shopping.interfaces.rest;


import io.smallrye.mutiny.Uni;
import io.vertx.core.http.HttpServerResponse;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

import jakarta.interceptor.Interceptors;
import jakarta.validation.ConstraintViolationException;
import jakarta.validation.Valid;
import jakarta.validation.groups.ConvertGroup;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import per.sen.shopping.application.service.SysBackendUserService;
import per.sen.shopping.infrastructure.common.group.FindGroup;
import per.sen.shopping.infrastructure.common.response.ApiResponse;
import per.sen.shopping.infrastructure.common.response.HttpStatus;
import per.sen.shopping.model.dto.SysBackendUserDTO;

@ApplicationScoped
@Path("/quarkus/shopping/manager")
//@RouteBase(path = "/quarkus/shopping/manager")
public class SysBackendUserApi {
    @Inject
    SysBackendUserService sysBackendUserService;

    @POST
    @Path("/login")
    @Produces(MediaType.APPLICATION_JSON)
//    @Route(path = "/login", methods = Route.HttpMethod.POST)
    public Uni<ApiResponse> login(@Valid @ConvertGroup(to = FindGroup.class)  SysBackendUserDTO sysBackendUserDTO) {
        return sysBackendUserService.login(sysBackendUserDTO);
    }


}
